//
//  BirthDateView.m
//  YYPHSpeedJump
//
//  Created by speedjump on 15/12/28.
//  Copyright © 2015年 sujiang. All rights reserved.
//

#import "BirthDateView.h"

@implementation BirthDateView


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubviews];
    }
    return self;
}
- (void)addSubviews
{
    self.dataPicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, (200-50)*kHeightScale)];
    self.dataPicker.datePickerMode=UIDatePickerModeDate;
    
    NSDate *maxdate= [NSDate date];
    [self.dataPicker setMaximumDate:maxdate];
    [self addSubview:self.dataPicker];
    _saveBtn = [[UIButton alloc]initWithFrame:CGRectMake(280*kWidthScale, (200-50)*kHeightScale, 95*kWidthScale, 50*kHeightScale)];
    _saveBtn.backgroundColor =kColors(218, 166, 46, 1);
    [_saveBtn setTitle:@"保存" forState:UIControlStateNormal];
    
    [self addSubview:_saveBtn];
    _cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, (200-50)*kHeightScale, 95*kWidthScale, 50*kHeightScale)];
    _cancelBtn.backgroundColor = kColors(218, 166, 46, 1);
    [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
    [self addSubview:_cancelBtn];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
